package com.fzfnn.scrapbook.controller;

import com.fzfnn.scrapbook.service.RadarService;
import com.fzfnn.scrapbook.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/radar")
@Tag(name = "交友接口", description = "附近功能接口")
public class RadarController {

    @Autowired
    private RadarService radarService;
    @GetMapping("/nearby")
    @Operation(summary = "获取附近的人")
    public R findNearbyUsers(@RequestHeader("Authorization") String token) {
        return radarService.findUsersInSameCity(token);
    }

}
